<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>登入 - {:config('app.app_name')}</title>
<meta name="renderer" content="webkit">
<link rel="shortcut icon" href="[admin]/image/favicon.ico">
<link href="[admin]/BJUI/themes/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
    html, body { height: 100%; overflow: hidden; }
    body {
        font-family: "Verdana", "Tahoma", "Lucida Grande", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
        background: url([admin]/image/loginbg_07.jpg) no-repeat center center fixed;
        background-size: cover;
    }
    .form-control{height:37px;}
    .main_box{position:absolute; top:50%; left:56%; margin:-200px 0 0 -180px; padding:15px 20px; width:310px; height:360px; min-width:320px; background:#FAFAFA; background:rgba(255,255,255,0.5); box-shadow: 1px 5px 8px #888888; border-radius:6px;}
    .login_msg{height:30px;}
    .input-group >.input-group-addon.code{padding:0;}
    #captcha_img{cursor:pointer;}
    .main_box .logo img{height:35px;}
    .submitForm{margin-right: 40px;}
    @media (min-width: 768px) {
        .main_box {margin-left:-240px; padding:15px 55px; width:440px; left:51%;}
        .main_box .logo img{height:40px;}
    }
</style>
</head>
<body>
<div class="container">
    <div class="main_box">
        <form action="" id="login_form" method="post">
            <p class="text-center logo" style="margin:5px 0;"><img src="[admin]/image/logo.png"></p>
            <div class="login_msg text-center"><font id="my_msg" color="red"></font></div>
            <div class="form-group">
                <div class="input-group">
                    <span class="input-group-addon" id="sizing-addon-user"><span class="glyphicon glyphicon-user"></span></span>
                    <input type="text" class="form-control" id="username" name="username" value="" placeholder="登入账号" aria-describedby="sizing-addon-user">
                </div>
            </div>
            <div class="form-group">
                <div class="input-group">
                    <span class="input-group-addon" id="sizing-addon-password"><span class="glyphicon glyphicon-lock"></span></span>
                    <input type="password" class="form-control" id="pwd" name="password" placeholder="登入密码" aria-describedby="sizing-addon-password">
                </div>
            </div>
            <div class="form-group">
                <div class="checkbox">
                    <label for="j_remember" class="m"><input id="j_remember" name="remember" type="checkbox" value="1" style="zoom:159%;margin:0 0 0 -12px;">&nbsp;记住登入账号!</label>
                </div>
            </div>
            <div class="text-center">
                <button type="button" id="login_ok" class="btn btn-primary btn-nm submitForm">&nbsp;登&nbsp;&nbsp;入&nbsp;</button>
                <button type="reset" class="btn btn-default btn-nm">&nbsp;重&nbsp;&nbsp;置&nbsp;</button>
            </div>
            <div class="text-center" style="color:#555;font-size:11px;">
                <hr>
                Copyright &copy; 2020 - 2030 风行者
            </div>
        </form>
    </div>
</div>
<script src="[admin]/BJUI/js/jquery-1.7.2.min.js"></script>
<script src="[admin]/BJUI/js/jquery.cookie.js"></script>
<script type="text/javascript">
    //
    var username = $.cookie('admin_username') || '';
    var password = $.cookie('admin_password') || '';
    var remember = $.cookie('admin_remember') || 0;
    //
    if(username !== ''){
        $("#username").val(username);
        password == '' ? $("#pwd").focus() : $("#pwd").val(password.substr(0, 10));
    }else{
        $("#username").focus();
    }
    remember === 0 ? null :$("#j_remember").attr('checked', true);
    //
    $("form").keydown(function(e){
        var e = e || event,
        keycode = e.which || e.keyCode;
        if (keycode==13) {
            $(".submitForm").trigger("click");
        }
    });
    $(document).ready(function(){
        var msg = '{$message|default=""}';
        if($.trim(msg) != ''){
            $('#my_msg').html(msg);
        }
    });
    //
    $(".submitForm").click(function(){
        if ($("#username").val() == '' || $("#pwd").val() == '') {
            $('#my_msg').html("填写完整后方可登入");
            return false;
        }
        var $remember = $("#j_remember");
        if ($remember.attr('checked')) {
            $.cookie('admin_remember', 1, { path: '/', expires: 15 });
        } else {
            $.cookie('admin_remember', null, { path: '/' });  //删除cookie
        }
        $(".submitForm").html('登入中...');
        $('#login_form').submit();
    });
</script>
</body>
</html>